apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: redirect-scheme
  namespace: gateway-conformance-infra
spec:
  parentRefs:
  - name: same-namespace
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /scheme
    filters:
    - type: RequestRedirect
      requestRedirect:
        scheme: "https"
  - matches:
    - path:
        type: PathPrefix
        value: /scheme-and-host
    filters:
    - type: RequestRedirect
      requestRedirect:
        hostname: example.org
        scheme: "https"
  - matches:
    - path:
        type: PathPrefix
        value: /scheme-and-status
    filters:
    - type: RequestRedirect
      requestRedirect:
        scheme: "https"
        statusCode: 301
  - matches:
    - path:
        type: PathPrefix
        value: /scheme-and-host-and-status
    filters:
    - type: RequestRedirect
      requestRedirect:
        scheme: "https"
        statusCode: 302
        hostname: example.org

